home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / osdep / os-os2.h < prev    next >
C/C++ Source or Header  |  1996-06-05  |  15KB  |  443 lines

  1. #line 2 "osdep/os-os2.h"
  2. /*----------------------------------------------------------------------
  3.   $Id: os-os2.h,v 4.7 1996/06/05 17:12:38 mikes Exp $
  4.  
  5.             T H E    P I N E    M A I L   S Y S T E M
  6.  
  7.    Laurence Lundblade and Mike Seibel
  8.    Networks and Distributed Computing
  9.    Computing and Communications
  10.    University of Washington
  11.    Administration Builiding, AG-44
  12.    Seattle, Washington, 98195, USA
  13.    Internet: lgl@CAC.Washington.EDU
  14.              mikes@CAC.Washington.EDU
  15.  
  16.    Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17.  
  18.  
  19.    Pine and Pico are registered trademarks of the University of Washington.
  20.    No commercial use of these trademarks may be made without prior written
  21.    permission of the University of Washington.
  22.  
  23.    Pine, Pico, and Pilot software and its included text are Copyright
  24.    1989-1996 by the University of Washington.
  25.  
  26.    The full text of our legal notices is contained in the file called
  27.    CPYRIGHT, included with this distribution.
  28.  
  29.  
  30.    Pine is in part based on The Elm Mail System:
  31.     ***********************************************************************
  32.     *  The Elm Mail System  -  Revision: 2.13                             *
  33.     *                                                                     *
  34.     *             Copyright (c) 1986, 1987 Dave Taylor              *
  35.     *             Copyright (c) 1988, 1989 USENET Community Trust   *
  36.     ***********************************************************************
  37.  
  38.  
  39.   ----------------------------------------------------------------------*/
  40.  
  41. #ifndef _OS_INCLUDED
  42. #define _OS_INCLUDED
  43.  
  44.  
  45. /*----------------------------------------------------------------------
  46.  
  47.    This first section has some constants that you may want to change
  48.    for your configuration.  This is the DOS version of the os.h file.
  49.    Further down in the file are os-dependent things that need to be set up
  50.    correctly for each os.  They aren't interesting, they just have to be
  51.    right.  There are also a few constants down there that may be of
  52.    interest to some.
  53.  
  54.  ----*/
  55.  
  56. /*----------------------------------------------------------------------
  57.  Define this if you want the disk quota to be checked on startup.
  58.  Of course, this only makes sense if your system has quotas.  If it doesn't,
  59.  there should be a dummy disk_quota() routine in os-xxx.c so that defining
  60.  this won't be harmful anyway.
  61.  ----*/
  62. /* #define USE_QUOTAS */
  63.  
  64.  
  65.  
  66. /*----------------------------------------------------------------------
  67.    Define this if you want to allow the users to change their From header
  68.    line when they send out mail.  The users will still have to configure
  69.    either default-composer-hdrs or customized-hdrs to get at the From
  70.    header, even if this is set.
  71.  ----*/
  72. /* #define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
  73.  
  74.  
  75.  
  76. /*----------------------------------------------------------------------
  77.     Turn this on if you want to disable the keyboard lock function.
  78.  ----*/
  79. /* #define NO_KEYBOARD_LOCK */
  80.  
  81.  
  82.  
  83. /*----------------------------------------------------------------------
  84.     Turn this on if it's OK to encode sent message text containing
  85.   "From " at the beginning of any line.
  86.  ----*/
  87. /* #define ENCODE_FROMS */
  88.  
  89.  
  90.  
  91. /*----------------------------------------------------------------------
  92.     Turn this on if you want to disable PC-Pine's including of 
  93.   "X-Warning" and "X-Sender" header lines in outgoing messages.
  94.  ----*/
  95. /* #define NOAUTH */
  96.  
  97.  
  98.  
  99. /*----------------------------------------------------------------------
  100.     Timeouts (seconds)
  101.  ----*/
  102. #define DF_MAILCHECK      "150" /* How often to check for new mail. There's 
  103.                                    some expense in doing this so it shouldn't
  104.                                    be done too frequently.  */
  105.  
  106. /*----------------------------------------------------------------------
  107.     Check pointing (seconds)
  108.  ----*/
  109. #define CHECK_POINT_TIME (7*60) /* Check point the mail file (write changes
  110.                    to disk) if more than CHECK_POINT_TIME
  111.                    seconds have passed since the first
  112.                    change was made.  Depending on what is
  113.                    happening, we may wait up to three times
  114.                    this long, since we don't want to do the
  115.                    slow check pointing and irritate the user. */
  116.                                      
  117. #define CHECK_POINT_FREQ   (12) /* Check point the mail file if there have been
  118.                                    at least this many (status) changes to the
  119.                    current mail file.  We may wait longer if
  120.                    it isn't a good time to do the checkpoint. */
  121.  
  122.  
  123.  
  124. /*----------------------------------------------------------------------
  125.  In scrolling through text, the number of lines from the previous
  126.  screen to overlap when showing the next screen.  Usually set to two.
  127.  ----*/
  128. #define    DF_OVERLAP        "2"
  129.  
  130.  
  131.  
  132. /*----------------------------------------------------------------------
  133.  When scrolling screens, the number of lines from top and bottom of
  134.  the screen to initiate single-line scrolling.
  135.  ----*/
  136. #define    DF_MARGIN    "0"
  137.  
  138.  
  139.  
  140. /*----------------------------------------------------------------------
  141.  Default fill column for pine composer and maximum fill column.  The max
  142.  is used to stop people from setting their custom fill column higher than
  143.  that number.  Note that DF_FILLCOL is a string but MAX_FILLCOL is an integer.
  144.  ----*/
  145. #define    DF_FILLCOL    "74"
  146. #define    MAX_FILLCOL    80
  147.  
  148.  
  149.  
  150. /*----- System-wide config file ----------------------------------------*/
  151. #define SYSTEM_PINERC "pinerc"
  152.  
  153.  
  154.  
  155. /*----- Used only in DOS -----------------------------------------------*/
  156. #define DF_PINEDIR      "\\pine"
  157. #ifdef    HELPFILE
  158. #undef    HELPFILE
  159. #define HELPFILE        "pine.hlp"
  160. #define HELPINDEX       "pine.ndx"
  161. #endif
  162.  
  163.   
  164. /*----------------------------------------------------------------------
  165.    The default folder names and folder directories (some for backwards
  166.    compatibility).  Think hard before changing any of these.
  167.  ----*/
  168. #define DF_DEFAULT_FCC            "sentmail"
  169. #define DEFAULT_SAVE              "savemail"
  170. #define POSTPONED_MAIL            "postpone"
  171. #define POSTPONED_MSGS            "postpond"
  172. #define INTERRUPTED_MAIL          "intruptd"
  173. #define DEADLETTER                "deadletr"
  174. #define    DF_FOLDER_EXTENSION      "mtx"
  175. #define DF_MAIL_DIRECTORY         "mail"
  176. #define INBOX_NAME                "INBOX"
  177. #define DF_SIGNATURE_FILE         "pine.sig"
  178. #define DF_ELM_STYLE_SAVE         "no"
  179. #define DF_HEADER_IN_REPLY        "no"
  180. #define DF_OLD_STYLE_REPLY        "no"
  181. #define DF_USE_ONLY_DOMAIN_NAME   "no"
  182. #define DF_FEATURE_LEVEL          "sapling"
  183. #define DF_SAVE_BY_SENDER         "no"
  184. #define DF_SORT_KEY               "arrival"
  185. #define DF_AB_SORT_RULE           "fullname-with-lists-last"
  186. #define DF_SAVED_MSG_NAME_RULE    "default-folder"
  187. #define DF_FCC_RULE               "default-fcc"
  188. #define DF_STANDARD_PRINTER       "PRN"
  189. #define ANSI_PRINTER              "attached-to-ansi"
  190. #define DF_ADDRESSBOOK            "addrbook"
  191. #define DF_BUGS_FULLNAME          "Pine Developers"
  192. #define DF_BUGS_ADDRESS           "pine-bugs@cac.washington.edu"
  193. #define DF_SUGGEST_FULLNAME       "Pine Developers"
  194. #define DF_SUGGEST_ADDRESS        "pine-suggestions@cac.washington.edu"
  195. #define DF_PINEINFO_FULLNAME      "Pine-Info News Group"
  196. #define DF_PINEINFO_ADDRESS       "pine-info@cac.washington.edu"
  197. #define DF_LOCAL_FULLNAME         "Local Support"
  198. #define DF_LOCAL_ADDRESS          "postmaster"
  199. #define DF_KBLOCK_PASSWD_COUNT    "1"
  200.  
  201. /*----------------------------------------------------------------------
  202.    The default printer when pine starts up for the first time with no printer
  203.  ----*/
  204. #define DF_DEFAULT_PRINTER        DF_STANDARD_PRINTER
  205.  
  206.  
  207.  
  208. /*----------------------------------------------------------------------
  209.  
  210.    OS dependencies, OS/2 version.  See also the os-os2.c files.
  211.    The following stuff may need to be changed for a new port, but once
  212.    the port is done it won't change.  Further down in the file are a few
  213.    constants that you may want to configure differently than they
  214.    are configured, but probably not.
  215.  
  216.  ----*/
  217.  
  218.  
  219.  
  220. /*----------------- Are we ANSI? ---------------------------------------*/
  221. #define ANSI
  222.  
  223. /*------ If our compiler doesn't understand type void ------------------*/
  224. /* #define void char */
  225.  
  226. /*-------- Standard ANSI functions usually defined in stdlib.h ---------*/
  227. #include <stdlib.h>
  228. /*---- Declare getenv() if not already declared ------------------------*/
  229. /* char *getenv(); */
  230.  
  231.  
  232. /*------- Standard string functions ------------------------------------*/
  233. #include <string.h>
  234. /*---- Declare these if not already declared ---------------------------*/
  235. /* char *strcpy(), *strncpy(); */
  236.  
  237.  
  238. /*------- Include types.h if you have it -------------------------------*/
  239. #include <sys/types.h>
  240.  
  241.  
  242. /*------- Some systems need this ---------------------------------------*/
  243. /* #include <stdarg.h> */
  244.  
  245.  
  246. #include <io.h>
  247. #include <sys/stat.h>
  248. #include <sys/socket.h>
  249. #include <netinet/in.h>
  250. #include <netdb.h>
  251. #include <memory.h>
  252. #include <fcntl.h>
  253. #include <sys/timeb.h>
  254.  
  255. #undef ERROR
  256.  
  257.  
  258. /*---- Declare sys_errlist() if not already declared -------------------*/
  259. /* extern char *sys_errlist[]; */
  260.  
  261.  
  262.  
  263. /*----------------- locale.h -------------------------------------------*/
  264. /* #include <locale.h>  /* To make matching and sorting work right */
  265.  
  266.  
  267.  
  268. /*----------------- time.h ---------------------------------------------*/
  269. #include <time.h>
  270. /* plain time.h isn't enough on some systems */
  271. #include <sys/time.h>  /* For struct timeval usually in time.h */ 
  272.  
  273.  
  274. /*--------------- signal.h ---------------------------------------------*/
  275. #include <signal.h>
  276. /* #include <sys/signal.h> */
  277.  
  278. #undef    SIGCHLD                /* clear unsupp'd signal def */
  279.  
  280. #define SigType void
  281. /* #define SigType int */
  282.  
  283.  
  284. /* #define POSIX_SIGNALS */
  285. /* #define SYSV_SIGNALS    /* use System-V signal semantics (ttyin.c) */
  286.  
  287.  
  288. /*-------------- A couple typedef's for integer sizes ------------------*/
  289. typedef unsigned long usign32_t;
  290. typedef unsigned short usign16_t;
  291.  
  292.  
  293. /*-------------- qsort argument type -----------------------------------*/
  294. #define QSType void
  295. /* #define QSType char */
  296.  
  297.  
  298.  
  299. /*------ how help text is referenced (always char ** on Unix) ----------*/
  300. #ifdef HELPFILE
  301. #define HelpType short
  302. #define NO_HELP  (-1)
  303. #else
  304. #define HelpType char **
  305. #define NO_HELP (char **)NULL
  306. #endif
  307.  
  308.  
  309.  
  310. /*--------- System V terminal driver -----------------------------------*/
  311. /* #define HAVE_TERMIO   this is for pure System V */
  312. /* #define HAVE_TERMIOS  this is an alternative    */
  313. /*- Use the poll() system call instead of select() */
  314. /* #define USE_POLL */
  315. /*---- Use terminfo instead of termcap ---------------------------------*/
  316. /* #define USE_TERMINFO */
  317.  
  318.  
  319.  
  320. /*-- What argument does wait(2) take? Define this if it is a union -----*/
  321. /* #define HAVE_WAIT_UNION */
  322.  
  323.  
  324. /*-------- Is window resizing available? -------------------------------*/
  325. /* #define RESIZING */
  326.     /* Actually, under windows it is, but RESIZING compiles in UNIX 
  327.      * signals code for determining when the window resized.  Window's
  328.      * works differently. */
  329.  
  330.  
  331.  
  332.  
  333. /*-------- If no vfork, use regular fork -------------------------------*/
  334. #define vfork fork
  335.  
  336.  
  337.  
  338. /*----------------------------------------------------------------------
  339.     This is DOS specific and is used to determine if a mail message is
  340.  too big to fit in core.  It's just a static value now, but could be
  341.  turned into a fuller macro that takes an adaptive approach to figure
  342.  out what can fit into available free storage.
  343.  Examining mailboxes around here, it looks like 90-something percent of
  344.  messages come in under 8K so that seems like an OK limit on what can
  345.  be dealt with in core.
  346.  ----*/
  347. /* #define MAX_MSG_INCORE  (8192L) */
  348.  
  349.  
  350.  
  351. /*----------------------------------------------------------------------
  352.     This is DOS specific and is used to pass the results of dos_gets
  353.  calls back to functions that had previously installed it as the
  354.  c-client "mailgets" allocation function.  It's basically a way around
  355.  c-client's exclusive use of malloc'd strings which is quite
  356.  impractical if we want to deal with text objects bigger than 64K on
  357.  DOS (assuming we even have 64 contiguous K anyway!).
  358.  ----*/
  359. /* extern  FILE    *append_file; */
  360.  
  361.  
  362.  
  363. /*----- The usual sendmail configuration for sending mail on Unix ------*/
  364. /* #define SENDMAIL    "/usr/lib/sendmail" */
  365. /* #define SENDMAILFLAGS    "-oi -oem -t"    */
  366.  
  367.  
  368. /*--------- Program employed by users to change their password ---------*/
  369. /* #define    PASSWD_PROG    "" */
  370.  
  371.  
  372. /*-------------- A couple constants used to size arrays ----------------*/
  373. /* #include <sys/param.h>          /* Get it from param.h if available */
  374. /* #define MAXPATH MAXPATHLEN      /* Longest pathname we ever expect */
  375. #define MAXPATH        (256)    /* Longest pathname we ever expect */
  376. #define MAXFOLDER      (64)     /* Longest foldername we ever expect */  
  377.  
  378.  
  379. /*-- Max screen pine will display on. Used to define some array sizes --*/
  380. #define MAX_SCREEN_COLS  (170) 
  381. #define MAX_SCREEN_ROWS  (200) 
  382.  
  383.  
  384. /*---- When no screen size can be discovered this is the size used -----*/
  385. #define DEFAULT_LINES_ON_TERMINAL    (25)
  386. #define DEFAULT_COLUMNS_ON_TERMINAL    (80)
  387.  
  388.  
  389. /*----------------------------------------------------------------------
  390.     Where to put the output of pine in debug mode. Files are created
  391.  in the user's home directory and have a number appended to them when
  392.  there is more than one.
  393.  ----*/
  394. #define DEBUGFILE    "pinedebg.txt"
  395. #define CRASHFILE    "pinecrsh.txt"
  396.  
  397.  
  398. /*----------------------------------------------------------------------
  399.     The number of debug files to save in the user's home diretory. The files
  400.  are useful for figuring out what a user did when he complains that something
  401.  went wrong. It's important to keep a bunch around, usually 4, so that the
  402.  debug file in question will still be around when the problem gets 
  403.  investigated. Users tend to go in and out of Pine a few times and there
  404.  is one file for each pine invocation
  405.  ----*/
  406. #define NUMDEBUGFILES 4
  407.  
  408. /*----------------------------------------------------------------------
  409.    The default debug level to set (approximate meanings):
  410.        1 logs only highest level events and errors
  411.        2 logs events like file writes
  412.        3
  413.        4 logs each command
  414.        5
  415.        6 
  416.        7 logs details of command execution (7 is highest to run any production)
  417.        8
  418.        9 logs gross details of command execution
  419.  ----*/
  420. #define DEFAULT_DEBUG 2
  421.  
  422.  
  423.  
  424. /*----------------------------------------------------------------------
  425.     Various maximum field lengths, probably shouldn't be changed.
  426.  ----*/
  427. #define MAX_FULLNAME     (100) 
  428. #define MAX_NICKNAME      (40)
  429. #define MAX_ADDRESS      (200)
  430. #define MAX_NEW_LIST     (500)  /* Max addrs to be added when creating list */
  431. #define MAX_SEARCH       (100)  /* Longest string to search for             */
  432. #define MAX_ADDR_EXPN   (1000)  /* Longest expanded addr                    */
  433. #define MAX_ADDR_FIELD (10000)  /* Longest fully-expanded addr field        */
  434.  
  435. extern int kbd_ready();
  436. extern int kbd_getkey();
  437.  
  438. #ifndef fflush
  439. #define fflush os2_fflush
  440. #endif
  441.  
  442. #endif /* _OS_INCLUDED */
  443.